{% extends "base.html" %}

{% block content %}

<div>
<h1> InviteThem </h1>
{% if accept_invite_form %}
<form method='post' action=''>
    {% csrf_token %}
    {{ accept_invite_form.as_table }}
    <input type="submit" name = "accept" value="Reply to Invitation">
</form>
{% endif %}

<table border = "1">
  <tr>
    <th><strong>User</strong></th>
    <th>Status</th>
  </tr>
    {% for user_in_session in user_in_sessions %}
        <tr class="altrow"> 
          <td> {{ user_in_session.user.user.username }} </td>
          <td>
            {% if user_in_session.joined == 1 %}
                 Ready!
            {% else %} {% if user_in_session.joined == 0 %} 
                Pending... 
            {% else %} {% if user_in_session.joined == 2 %}
                Rejected :(
            {% endif %}
            {% endif %}
            {% endif %}
          </td>
        </tr>
    {% endfor %}
</ul>
</table>
<form method='post' value = "User name" action=''>
  {% csrf_token %}
  {{ inv_form.as_table }}
  <input type="submit" name = "invite" value="Invite User">
</form>

{% if move_on_form %}
  <form method='post' action=''>
    {% csrf_token %}
    {{ move_on_form.as_table }}
    <input type="submit" name = "moveon" value="Everyone is here!">
  </form>
{% endif %}

</div>
{% endblock %}



